package com.rency.ues.webapp.common;

import org.rency.common.utils.tool.DateUtils;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;

import java.util.Date;

public class WebProperty implements InitializingBean{

	@Value("#{sys['version']}")
	private String version;

	@Value("#{sys['description']}")
	private String description;
	
	@Value("#{sys['keywords']}")
	private String keywords;

    @Value("#{sys['login.username']}")
    private String userName;

    @Value("#{sys['login.password']}")
    private String password;
	
	private String validDate;
	
	public String getVersion() {
		return version;
	}

	public void setVersion(String version) {
		this.version = version;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getKeywords() {
		return keywords;
	}

	public void setKeywords(String keywords) {
		this.keywords = keywords;
	}

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getValidDate() {
		return validDate;
	}

	public void setValidDate(String validDate) {
		this.validDate = validDate;
	}

	@Override
	public void afterPropertiesSet() throws Exception {
		this.validDate = DateUtils.format(DateUtils.addYear(new Date(),1), "yyyy");
	}
	
}